# -*- coding: utf-8 -*
import time

from celeryapp import app,KProducer


@app.task
def multiply(x, y):
    result = x * y
    bootstrap_servers = ['127.0.0.1:9092']
    topic = 'psaems.power.useinfo'
    ##发送到kafka
    kfk = KProducer()
    kfk.Connect(bootstrap_servers, topic)
    kfk.sendInfo(result)

    print('**************************')
    return result
